package models

import (
	"fmt"
	"github.com/go-redis/redis"
	"huodo/conf"
)

var RedisDB *redis.Client

func ExampleNewClient() {
	RedisDB = redis.NewClient(&redis.Options{
		Addr:     conf.ConfigData.Redis.Addr,
		Password: conf.ConfigData.Redis.Password, // no password set
		DB:       conf.ConfigData.Redis.DB,       // use default DB
	})

	pong, err := RedisDB.Ping().Result()
	fmt.Println(pong, err)
	// Output: PONG <nil>
}
